knitr::opts_knit$set(root.dir = '../../')

1 Overall Activation

source('scripts/my_r.R')
library(feather)
## Warning: package 'feather' was built under R version 3.3.2
library(ggplot2)
library(reshape2)
library(bsselectR)
info <- c('Type1', 'newseq.matchgc.E081', 'motif_activation')
pos <- load_and_melt('pattern/Type1/newseq.matchgc.E081/motif_activation/pattern_positive.feather')
neg <- load_and_melt('pattern/Type1/newseq.matchgc.E081/motif_activation/pattern_negative.feather')
ggplot(pos$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Positive)') + labs(x = 'motif', y = 'sequence')

ggplot(neg$table.melted) + geom_raster(aes(x = variable, y = id, fill = value)) + scale_fill_gradient2() + ggtitle('Activation per sequence (Negative)') + labs(x = 'motif', y = 'sequence')

2 Per Motif Activation

pvalues <- c()
motifs <- c()
for(i in colnames(pos$table)){
    if(i != 'id'){
        poss <- pos$table[[i]]
        negs <- neg$table[[i]]
        pvalues <- c(pvalues, wilcox.test(poss, negs)$p.value)
        motifs <- c(motifs, i)
    }
}
df <- data.frame(motif=motifs, p.value=pvalues)

2.1 Motif activation comparison (positive vs negative)

3 Show top 20 motifs

3.1 1 : Motif.106

1 : Motif.106

1 : Motif.106

3.2 2 : Motif.91

2 : Motif.91

2 : Motif.91

3.3 3 : Motif.253

3 : Motif.253

3 : Motif.253

3.4 4 : Motif.73

4 : Motif.73

4 : Motif.73

3.5 5 : Motif.111

5 : Motif.111

5 : Motif.111

3.6 6 : Motif.260

6 : Motif.260

6 : Motif.260

3.7 7 : Motif.274

7 : Motif.274

7 : Motif.274

3.8 8 : Motif.259

8 : Motif.259

8 : Motif.259

3.9 9 : Motif.309

9 : Motif.309

9 : Motif.309

3.10 10 : Motif.99

10 : Motif.99

10 : Motif.99

3.11 11 : Motif.28

11 : Motif.28

11 : Motif.28

3.12 12 : Motif.185

12 : Motif.185

12 : Motif.185

3.13 13 : Motif.209

13 : Motif.209

13 : Motif.209

3.14 14 : Motif.45

14 : Motif.45

14 : Motif.45

3.15 15 : Motif.299

15 : Motif.299

15 : Motif.299

3.16 16 : Motif.133

16 : Motif.133

16 : Motif.133

3.17 17 : Motif.221

17 : Motif.221

17 : Motif.221

3.18 18 : Motif.83

18 : Motif.83

18 : Motif.83

3.19 19 : Motif.23

19 : Motif.23

19 : Motif.23

3.20 20 : Motif.258

20 : Motif.258

20 : Motif.258